import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 用户个人信息
    userData:{
      chineseName:'',
      id:'',
      env:'',
      name:''
    }
  },
  mutations: {
    // 记录用户基本信息
    setUserData(stata, data){
      this.state.userData.id = data.id;
      this.state.userData.env = data.env;
      this.state.userData.name = data.name;
      this.state.userData.chineseName = data.chineseName;
    },
    // sessionStorge
    resetState(state , data){
      this.state.userData =data.userData;
    },
    // chineseName
    setChineseName(state , name){
      this.state.userData.chineseName = name;
    }

  },
  actions: {
  },
  modules: {
  }
})
